package org.sivan.buffly.player;

import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

import java.net.URL;

/**
 * 播放音乐的类
 */
public class Player {
    public static void playMusic(String file) {
        String music = Player.class.getResource(file).toString();
        Media media = new Media(music);
        MediaPlayer player = new MediaPlayer(media);
        player.play();
    }
}
